/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* findPeaks(int* mountain, int mountainSize, int* returnSize) {
    int n=mountainSize;
    int i=1;
    int c=0;
    int *res=(int*)malloc(sizeof(int)*n);
    for(i=1;i<mountainSize-1;i++)
       {
        if(mountain[i]>mountain[i-1]&&mountain[i]>mountain[i+1])
        {
         res[c++]=i;
        }
       }
       *returnSize=c;
    return res;
}
